package com.lxch.gdwxp.wxpay.porperties;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

/**
 *
 * 微信支付配置类，绑定配置文件上的参数，参数就在配置文件中修改
 *
 */
@Configuration
@ConfigurationProperties
@PropertySource("classpath:config/WXPay.yml")
public class WXPayProperties {
    private String KEY;

    @Override
    public String toString() {
        return "WXPayProperties{" +
                "KEY='" + KEY + '\'' +
                ", APPID='" + APPID + '\'' +
                ", APPSECRET='" + APPSECRET + '\'' +
                ", MCHID='" + MCHID + '\'' +
                ", CONNECTTIMEOUTMS=" + CONNECTTIMEOUTMS +
                ", READTIMEOUTMS=" + READTIMEOUTMS +
                ", NOTIFY_URL='" + NOTIFY_URL + '\'' +
                ", CertPath='" + CertPath + '\'' +
                ", CertEncoding='" + CertEncoding + '\'' +
                ", RASKEYPATH='" + RASKEYPATH + '\'' +
                '}';
    }

    private String APPID;
    private String APPSECRET;
    //商户id
    private String MCHID;
    //连接超时时间，单位是毫秒
    private Long CONNECTTIMEOUTMS;
    //读超时时间，单位是毫秒
    private Long READTIMEOUTMS;
    // 支付回调路径
    private String NOTIFY_URL;
    //            支付证书文件地址
    private String CertPath;
    private String CertEncoding;

    public void setCertEncoding(String certEncoding) {
        CertEncoding = certEncoding;
    }

    public String getCertEncoding() {

        return CertEncoding;
    }

    //            RAS文件路径
    private String RASKEYPATH;

    public void setKEY(String KEY) {
        this.KEY = KEY;
    }

    public void setAPPID(String APPID) {
        this.APPID = APPID;
    }

    public void setAPPSECRET(String APPSECRET) {
        this.APPSECRET = APPSECRET;
    }

    public void setMCHID(String MCHID) {
        this.MCHID = MCHID;
    }

    public void setCONNECTTIMEOUTMS(Long CONNECTTIMEOUTMS) {
        this.CONNECTTIMEOUTMS = CONNECTTIMEOUTMS;
    }

    public void setREADTIMEOUTMS(Long READTIMEOUTMS) {
        this.READTIMEOUTMS = READTIMEOUTMS;
    }

    public void setNOTIFY_URL(String NOTIFY_URL) {
        this.NOTIFY_URL = NOTIFY_URL;
    }

    public void setCertPath(String certPath) {
        CertPath = certPath;
    }

    public void setRASKEYPATH(String RASKEYPATH) {
        this.RASKEYPATH = RASKEYPATH;
    }

    public String getKEY() {

        return KEY;
    }

    public String getAPPID() {
        return APPID;
    }

    public String getAPPSECRET() {
        return APPSECRET;
    }

    public String getMCHID() {
        return MCHID;
    }

    public Long getCONNECTTIMEOUTMS() {
        return CONNECTTIMEOUTMS;
    }

    public Long getREADTIMEOUTMS() {
        return READTIMEOUTMS;
    }

    public String getNOTIFY_URL() {
        return NOTIFY_URL;
    }

    public String getCertPath() {
        return CertPath;
    }

    public String getRASKEYPATH() {
        return RASKEYPATH;
    }
}
